﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace QLBH.Base
{
    public class MD5Helper
    {
        /// <summary>
        /// return MD5 encrypt of string in bytes
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static byte[] GetMD5(string input)
        {
            Byte[] originalBytes;
            Byte[] encodedBytes;
            MD5 md5;

            md5 = new MD5CryptoServiceProvider();
            originalBytes = ASCIIEncoding.Unicode.GetBytes(input);
            encodedBytes = md5.ComputeHash(originalBytes);
            return encodedBytes;
        }
    }
}
